[libapreq] unknown content-type: `application/octet-stream'

hi, list

I'm using a javascript ajax file uploader, but get this error with mod_perl1.

the js code is like:

var xhr = new XMLHttpRequest();

xhr.open("POST", queryString, true);
xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
xhr.setRequestHeader("X-File-Name", encodeURIComponent(name));
xhr.setRequestHeader("Content-Type", "application/octet-stream");
xhr.send(file);
silent [ Fr, 12 August 2011 04:47 ] [ ID #2063266 ]

Re: [libapreq] unknown content-type: `application/octet-stream'

On 08/11/2011 09:47 PM, silent wrote:
> hi, list
>
> I'm using a javascript ajax file uploader, but get this error with mod_perl1.
>
> the js code is like:
>
> var xhr = new XMLHttpRequest();
>
> xhr.open("POST", queryString, true);
> xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
> xhr.setRequestHeader("X-File-Name", encodeURIComponent(name));
> xhr.setRequestHeader("Content-Type", "application/octet-stream");
> xhr.send(file);
libapreq can only parse 'application/x-www-form-urlencoded' or
'multipart/form-data'.

So if you want use Apache::Request (libapreq) and handle file uploads,
you should use a Content-Type of 'multipart/form-data'.

Or write your own request parser.

Regards.

Salvador Ortiz.
Salvador Ortiz Garcia [ Fr, 12 August 2011 10:22 ] [ ID #2063267 ]
Webserver » gmane.comp.apache.mod-perl » [libapreq] unknown content-type: `application/octet-stream'

Vorheriges Thema: Changing Apache configuration for each request
Nächstes Thema: Running the a cgi script with Apache::Test